#ifndef BUFFERREADER_H
#define BUFFERREADER_H

#include <string>
#include "Types.h"

using std::string;

class BufferReader {
public:
	BufferReader(unsigned char *buffer, uint32_t bufferLen);
	int8_t getByte();
	int8_t getByte(int32_t pos);
	int16_t getShort();
	int16_t getShort(int32_t pos);
	int32_t getInt();
	int32_t getInt(int32_t pos);
	int64_t getLong();
	int64_t getLong(int32_t pos);
	string getString();
	string getString(int32_t pos);
	double getDouble();
	double getDouble(int32_t pos);
	uint32_t getPos() const { return this->pos; }
	void setPos(uint32_t pos) { this->pos = pos; }
private:
	uint32_t pos;
	uint32_t length;
	unsigned char *buffer;
};

#endif
